package officeserver.office.request;

import java.io.Serializable;

import officeserver.log_error.OfficeException;
import officeserver.office.Office;

/**
 * @author Chris Bayruns
 * 
 */
public abstract class OfficeRequest implements Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = -2191152875653769090L;
	protected Object[] data;
    protected Object[] args;

    protected Exception error;

    // Direction = true if setting stuff, else just getting stuff
    protected boolean directionIn = false;

    /**
     * @author Chris Bayruns
     */
    public OfficeRequest() {
	error = null;
    }

    /**
     * @author Chris Bayruns
     * @return
     */
    public Exception getError() {
	return error;
    }

    /**
     * @author Chris Bayruns
     * @param data
     */
    public void setData(Object[] data) {
	this.data = data;
    }

    /**
     * @author Chris Bayruns
     * @param args
     */
    public void setArgs(Object[] args) {
	this.args = args;
    }

    /**
     * @author Chris Bayruns
     * @param direction
     */
    public void setDirection(boolean direction) {
	this.directionIn = direction;
    }

    /**
     * @author Chris Bayruns
     * @return
     */
    public Object[] getData() {
	return data;
    }

    /**
     * @author Chris Bayruns
     * @return
     */
    public Object[] getArgs() {
	return args;
    }

    /**
     * @author Chris Bayruns
     * @return
     */
    public boolean isDirection() {
	return directionIn;
    }

    public abstract void processRequest(Office in);

}
